<#macro listItem result>
<#assign newItems = result.newItems>
	<#if (newItems?size > 0)>
	[A]:
		<#list result.newItems as aItem>
		(A${aItem_index+1})${aItem}
		</#list>
	</#if>
	<#assign deletedItems = result.deletedItems>
	<#if (deletedItems?size > 0)>
	[D]:
		<#list deletedItems as dItem>
		(D${dItem_index+1})${dItem}
		</#list>
	</#if>
	<#assign conflictItemMap = result.conflictItemMap>
	<#if (conflictItemMap?size > 0)>
  [C]:
		<#list conflictItemMap?keys as key>
    (C${key_index+1} ${key})
			<#assign conflictItems = conflictItemMap[key]>
			<#if (conflictItems?size > 0)>
				<#list conflictItems as cItem>
      [${cItem.item}] => {[PV]: ${cItem.firstItemContent}, [GV]: ${cItem.secondItemContent}}
				</#list>
			</#if>
		</#list>
	</#if>
</#macro>

<#assign pvConnInfo = root.pvConnInfo>
<#assign gvConnInfo = root.gvConnInfo>
<#assign consCheckResult = root.consCheckResult>

[生产版本库]
主机 : ${pvConnInfo.host}
端口 : ${pvConnInfo.port}
库 : ${pvConnInfo.db}
表 : ${root.pvTable}

[灰度版本库]
主机 : ${gvConnInfo.host}
端口 : ${gvConnInfo.port}
库 : ${gvConnInfo.db}
表 : ${root.gvTable}

[一致性校验结果]

表结构一致性 : ${consCheckResult.coincident?string("YES", "NO")}

<#if !consCheckResult.coincident>
<#assign tbInfoCheckResult = consCheckResult.tbInfoCheckResult>
	<#if !tbInfoCheckResult.coincident>
[表定义]
	<@listItem result = tbInfoCheckResult></@listItem>
	</#if>

<#assign colInfoCheckResult = consCheckResult.colInfoCheckResult>
	<#if !colInfoCheckResult.coincident>
[列定义]
	<@listItem result = colInfoCheckResult></@listItem>
	</#if>
	
<#assign tbConstCheckResult = consCheckResult.tbConstCheckResult>
	<#if !tbConstCheckResult.coincident>
[表约束定义]
	<@listItem result = tbConstCheckResult></@listItem>
	</#if>
	
<#assign colConstCheckResult = consCheckResult.colConstCheckResult>
	<#if !colConstCheckResult.coincident>
[列约束定义]
	<@listItem result = colConstCheckResult></@listItem>
	</#if>

<#assign idxInfoCheckResult = consCheckResult.idxInfoCheckResult>
	<#if !idxInfoCheckResult.coincident>
[索引定义]
	<@listItem result = idxInfoCheckResult></@listItem>
	</#if>
</#if>